﻿using System;
using GNUGo.Net.WebApp.Entities;

namespace GNUGo.Net.WebApp.WsClasses {
	[Serializable]
	public class WsPlayer {
		public WsPlayer() { }

		public WsPlayer(GoPlayer goPlayer) {
			Name = goPlayer.Name;
			FacebookUserId = goPlayer.FacebookUserId;
			PlayerId = goPlayer.PlayerId;
			IgsUsername = goPlayer.IgsUsername;
			if (!String.IsNullOrEmpty(goPlayer.IgsPassword))
				IgsPassword = "********";
			else
				IgsPassword = null;
			IgsRank = goPlayer.IgsRank;
			Email = goPlayer.NotificationEmail;
		}

		public override string ToString() {
			return
				String.Format(
					"Name = {0} FacebookUserId = {1}, PlayerId = {2}, PlayerId = {3}, IgsUsername = {4}, IgsPassword = {5}, IgsRank = {6}, Email = {7}",
					Name, FacebookUserId, PlayerId, IgsUsername, IgsPassword, IgsRank, Email);
		}

		public string Name { get; set; }
		public string FacebookUserId { get; set; }
		public int PlayerId { get; set; }
		public string IgsUsername { get; set; }
		public string IgsPassword { get; set; }
		public string IgsRank { get; set; }
		public string Email { get; set; }
	}
}
